<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
<div id="test1" style="width:200px;height: 200px; border:1px solid #000;">test1:title</div>
<input type="checkbox" name="" id="test2">test2:checked checkbox <br>
<input type="radio" name="" id="test3">test:checked radio <br>
<select name="" id="test4">
    <option value="v1">test4-1</option>
    <option value="v2" selected>test4-2</option>
    <option value="v3">test4-3</option>
</select>

<script type="text/javascript">
    (function(document,window){
        function ln(selector){
            this.element=document.querySelector(selector);
            return this;
        }
        ln.prototype={
            firstChild:function(){
                return this.element.firstElementChild;
            },
            lastChild:function(){
                return this.element.lastElementChild;
            }
        };

        window.ln=ln;
    }(document,window));
    /*
    //调用可以这样：
    var ln=new ln('#test4');
    ln.firstChild();
    */
</script>


</body>
</html>